#ryh simple cmake project
cmake_minimum_required(VERSION 3.5.0)
project(unictrl VERSION 1.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_BUILD_TYPE Debug)

set(PROJECT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(PROJECT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include /usr/include/eigen3)

find_package(Threads REQUIRED)
find_package(unitree_sdk2 REQUIRED)

add_subdirectory(components)

if(TARGET PahoMqtt::Cpp)
    message(STATUS "Found imported target PahoMqtt::Cpp")
else()
    message(WARNING "Imported target PahoMqtt::Cpp not found!")
endif()

add_executable(${PROJECT_NAME} ${PROJECT_SOURCE_DIR}/main.cpp
                               ${PROJECT_SOURCE_DIR}/application.cpp
                               ${PROJECT_SOURCE_DIR}/radar.cpp
                               ${PROJECT_SOURCE_DIR}/audioplay.cpp
)

target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_INCLUDE_DIR})

target_link_libraries(${PROJECT_NAME} PRIVATE 
                      unitree_sdk2
                      PahoMqtt::Cpp
                      rt
                      )
